﻿using System;
using System.Collections.Specialized;


class Array_Calcu
{
    static void Main(string[] args)
    {
        Console.WriteLine("输入数组长度：");
        int array_len = Convert.ToInt32(Console.ReadLine());
        int[]array = new int[array_len];
        Console.WriteLine("输入数组数据：");
        for (int i = 0; i < array_len; i++)
        {
            array[i] = Convert.ToInt32(Console.ReadLine());
        }
        Console.WriteLine("数组最大值为：{0}",Max_num(array,array_len));
        Console.WriteLine("数组最小值为：{0}", Min_num(array, array_len));
        Console.WriteLine("数组均值为：{0}", Avg_num(array, array_len));
        Console.WriteLine("数组总值为：{0}", Sum_num(array, array_len));
    }

    //数组最大值
    static int Max_num(int[]array,int len)
    {
        int max_num = array[0];
        for(int i = 0; i < len; i++)
        {
            if(array[i] > max_num) max_num = array[i];
        }
        return max_num;
    }

    //数组最小值
    static int Min_num(int[] array, int len)
    {
        int min_num = array[0];
        for (int i = 0; i < len; i++)
        {
            if (array[i] < min_num) min_num = array[i];
        }
        return min_num;
    }

    //数组均值
    static int Avg_num(int[] array, int len)
    {
        int Sum = 0;
        for (int i = 0; i < len; i++)
        {
            Sum += array[i];
        }
        return Sum/len;
    }

    static int Sum_num(int[] array, int len)
    {
        int Sum = 0;
        for (int i = 0; i < len; i++)
        {
            Sum += array[0];
        }
        return Sum;
    }
}

